package com.example.tuike.service;
import com.example.tuike.entity.Platforms;
import com.example.tuike.mapper.PlatformsMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/*** @Author supersaiya
 * @Description TODO

 * @Date 2025/2/2 21:12

 * @Version 1.0*/



@Service
@RequiredArgsConstructor
public class PlatformsService {
    @Autowired
    private PlatformsMapper platformsMapper;


    public List<Platforms> getAllPlatforms() {
        return platformsMapper.findAll();
    }


    public Platforms getPlatformById(Integer platformId) {
        return platformsMapper.findById(platformId);
    }


    public Platforms createPlatform(Platforms platform) {
        platformsMapper.insert(platform);
        return platform;
    }


    public Platforms updatePlatform(Platforms platform) {
        platformsMapper.update(platform);
        return platform;
    }

    public void deletePlatform(Integer platformId) {
        platformsMapper.delete(platformId);
    }
}